package jsu.xnm.evelyn.util;

/**
 * @author xnm
 * @version 1.0
 */
//用于报错和获取当前用户登录的id
public class BaseContext {
    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Integer id){
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        Integer currentId = threadLocal.get();  // 获取 Integer 类型
        return currentId != null ? Long.valueOf(currentId) : null; // 使用 Long.valueOf() 转换为 Long
    }
}
